﻿namespace WMS6.Web.Inbound
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Linq;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.BaseInfoServiceRef;
    using WMS6.Web.CommonMethodServiceRef;
    using WMS6.Web.InboundDetailServiceRef;
    using WMS6.Web.InboundServiceRef;
    using WMS6.Web.UserControls;

    public class ASN : BasePage
    {
        protected HtmlInputButton btnAction;
        protected Button btnAddDetail;
        protected Button btnCopy;
        protected Button btnDelete;
        protected Button btnDeleteDetail;
        protected Button btnGoBack;
        protected Button btnImportData;
        protected Button btnInputPO;
        protected Button btnInputSO;
        protected Button btnNew;
        protected Button btnQuery;
        protected Button btnSave;
        protected DropDownList ddlContainerType;
        protected DropDownList ddlIncoTerms;
        protected DropDownList ddlPaymentTerm;
        protected DropDownList ddlReceiptType;
        protected DropDownList ddlStatus;
        protected DropDownList ddlStatusQuery;
        protected DropDownList ddlTransportationMode;
        protected HtmlGenericControl divM6;
        protected HtmlForm F4011;
        protected GridView gvReceiptDetail;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnCopy;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlInputHidden hdnFlag;
        protected HtmlInputHidden hdnFrom;
        protected HtmlInputHidden hdnImportPOValue;
        protected HtmlInputHidden hdnInportValue;
        protected HtmlInputHidden hdnIspalletized;
        protected HtmlInputHidden hdnLineID;
        protected HtmlInputHidden hdnPageQty;
        protected HtmlInputHidden hdnPageType;
        protected HtmlInputHidden hdnReceiptID;
        protected HtmlInputHidden hdnSoID;
        protected HtmlInputHidden hdnType;
        protected HtmlInputHidden hdnTypeValue;
        protected HtmlInputButton htmlbtnReport;
        protected HtmlImage imgOwnerID;
        protected Label lblArrivalDate;
        protected Label lblCarrierAddress;
        protected Label lblCarrierCity;
        protected Label lblCarrierContact;
        protected Label lblCarrierCountry;
        protected Label lblCarrierFax;
        protected Label lblCarrierID;
        protected Label lblCarrierMail;
        protected Label lblCarrierName;
        protected Label lblCarrierPhone;
        protected Label lblCarrierProv;
        protected Label lblCarrierRef;
        protected Label lblCarrierZIP;
        protected Label lblContainerQty;
        protected Label lblContainerType;
        protected Label lblCreatedBy;
        protected Label lblCreatedDate;
        protected Label lblDestCountry;
        protected Label lblDriverName;
        protected Label lblExpetedReceiptDate;
        protected Label lblExternalReceiptID;
        protected Label lblIncoTerms;
        protected Label lblMsg;
        protected Label lblOwner;
        protected Label lblOwnerID;
        protected Label lblPackingSlipNumber;
        protected Label lblPaymentTerm;
        protected Label lblPlaceOfDelivery;
        protected Label lblPlaceOfDischarge;
        protected Label lblPlaceOfLoading;
        protected Label lblPoID;
        protected Label lblReceiptDate;
        protected Label lblReceiptID;
        protected Label lblReceiptType;
        protected Label lblRemark;
        protected Label lblRma;
        protected Label lblSkuQuery;
        protected Label lblSrcCountry;
        protected Label lblStatus;
        protected Label lblStatusQuery;
        protected Label lblTotalCube;
        protected Label lblTotalExceptQty;
        protected Label lblTotalExpected;
        protected Label lblTotalExpectedQty;
        protected Label lblTotalGrossWeight;
        protected Label lblTotalReceiptQty;
        protected Label lblTotalReceived;
        protected Label lblTotalReceivedQty;
        protected Label lblTrailerNumber;
        protected Label lblTrailerOwner;
        protected Label lblTransportationMode;
        protected Label lblUdf04;
        protected Label lblUdf09;
        protected Label lblUdf1;
        protected Label lblUdf10;
        protected Label lblUdf2;
        protected Label lblUdf3;
        protected Label lblUdf5;
        protected Label lblUdf6;
        protected Label lblUdf7;
        protected Label lblUdf8;
        protected Label lblVehicleNumber;
        protected Label lblVendorAddress;
        protected Label lblVendorCity;
        protected Label lblVendorContact;
        protected Label lblVendorCountry;
        protected Label lblVendorEmail;
        protected Label lblVendorFax;
        protected Label lblVendorID;
        protected Label lblVendorName;
        protected Label lblVendorPhone;
        protected Label lblVendorProv;
        protected Label lblVendorRef;
        protected Label lblVendorZip;
        protected Label lblWareHouseRef;
        protected LinkButton lnkbtnImportPo;
        protected LinkButton lnkbtnImportSo;
        protected LinkButton lnkbtnPrintReceipt;
        protected LinkButton lnkbtnUdf;
        protected LinkButton lnkLpnGenerate;
        protected HtmlLink mycss;
        protected Label one1;
        protected Label one2;
        protected Label one3;
        protected Label one4;
        protected Label one5;
        protected Label one6;
        protected Pager PagerFooter;
        protected ScriptManager ScriptManager1;
        protected HtmlTableCell tdlnkbtnImportPo;
        protected HtmlTableCell tdlnkbtnImportSo;
        protected HtmlTableCell tdlnkbtnPrintReceipt;
        protected HtmlTableCell tdlnkbtnUdf;
        protected HtmlTableCell tdlnkLpnGenerate;
        private decimal totalExpectedQty;
        private decimal totalReceivedQty;
        protected TextBox txtArrivalDate;
        protected TextBox txtCarrierAddress;
        protected TextBox txtCarrierCity;
        protected TextBox txtCarrierContact;
        protected TextBox txtCarrierCountry;
        protected TextBox txtCarrierFax;
        protected TextBox txtCarrierID;
        protected TextBox txtCarrierMail;
        protected TextBox txtCarrierName;
        protected TextBox txtCarrierPhone;
        protected TextBox txtCarrierProv;
        protected TextBox txtCarrierRef;
        protected TextBox txtCarrierZIP;
        protected TextBox txtContainerQty;
        protected TextBox txtCreatedBy;
        protected TextBox txtCreatedDate;
        protected TextBox txtDestCountry;
        protected TextBox txtDriverName;
        protected TextBox txtExpetedReceiptDate;
        protected TextBox txtExternalReceiptID;
        protected TextBox txtOwnerID;
        protected TextBox txtPackingSlipNumber;
        protected TextBox txtPlaceOfDelivery;
        protected TextBox txtPlaceOfDischarge;
        protected TextBox txtPlaceOfLoading;
        protected TextBox txtPoID;
        protected TextBox txtReceiptDate;
        protected TextBox txtReceiptID;
        protected TextBox txtRemark;
        protected TextBox txtRma;
        protected TextBox txtSkuQuery;
        protected TextBox txtSrcCountry;
        protected TextBox txtTotalCube;
        protected TextBox txtTotalExceptQty;
        protected TextBox txtTotalGrossWeight;
        protected TextBox txtTotalReceiptQty;
        protected TextBox txtTrailerNumber;
        protected TextBox txtTrailerOwner;
        protected TextBox txtUdf1;
        protected TextBox txtUdf10;
        protected TextBox txtUdf2;
        protected TextBox txtUdf3;
        protected TextBox txtUdf4;
        protected TextBox txtUdf5;
        protected TextBox txtUdf6;
        protected TextBox txtUdf7;
        protected TextBox txtUdf8;
        protected TextBox txtUdf9;
        protected TextBox txtVehicleNumber;
        protected TextBox txtVendorAddress;
        protected TextBox txtVendorCity;
        protected TextBox txtVendorContact;
        protected TextBox txtVendorCountry;
        protected TextBox txtVendorEmail;
        protected TextBox txtVendorFax;
        protected TextBox txtVendorID;
        protected TextBox txtVendorName;
        protected TextBox txtVendorPhone;
        protected TextBox txtVendorProv;
        protected TextBox txtVendorRef;
        protected TextBox txtVendorZip;
        protected TextBox txtWareHouseRef;
        protected UpdatePanel up1;
        protected UpdatePanel UpdatePanel1;

        private DataSet BindDataReceiptDetail(WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptDetail)
        {
            DataSet ds = InboundDetailServiceClientProxy.GetInstance().GetReceiptDetailInfoByPagerQueryEntity(receiptDetail);
            if (ds != null)
            {
                base.BindData2GridView(this.gvReceiptDetail, ds);
                if ((ds != null) && (ds.Tables.Count > 1))
                {
                    this.PagerFooter.PageInfo = ds.Tables[1].Rows[0]["CurrentPage"].ToString() + " / " + ds.Tables[1].Rows[0]["TotalPagesCount"].ToString() + "&nbsp;&nbsp;&nbsp;共: " + ds.Tables[1].Rows[0]["TotalRecordsCount"].ToString();
                    this.PagerFooter.TotalPages = int.Parse(ds.Tables[1].Rows[0]["TotalPagesCount"].ToString());
                }
            }
            this.UpdatePanel1.Update();
            this.hdnPageType.Value = "0";
            return ds;
        }

        protected void btnAddDetail_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.ddlStatus.SelectedValue.ToUpper() == "NEW")
                {
                    if (string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                    {
                        this.lblMsg.Text = base.GetGlobalMsgResource("F4100_002");
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(this.hdnLineID.Value))
                        {
                            this.InsertReceiptInfo();
                            this.hdnLineID.Value = "10";
                        }
                        base.Response.Redirect(string.Format("ASNDetail.aspx?from={0}&ID={1}&SeqNO={2}&ReceiptType={3}&Owner={4}&Vendor={5}&VName={6}&&ExternID={7}&Ispalletized={8}", new object[] { base.UrlEncode(this.hdnFrom.Value), base.UrlEncode(this.txtReceiptID.Text.Trim()), base.UrlEncode(this.hdnLineID.Value), base.UrlEncode(this.ddlReceiptType.SelectedValue), base.UrlEncode(this.txtOwnerID.Text.Trim()), base.UrlEncode(this.txtVendorID.Text.Trim()), base.UrlEncode(this.txtVendorName.Text.Trim()), base.UrlEncode(this.txtExternalReceiptID.Text.Trim()), base.UrlEncode(this.hdnIspalletized.Value) }), true);
                    }
                }
                else
                {
                    this.lblMsg.Text = base.GetGlobalMsgResource("F4100_015");
                }
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = ex.Message;
                this.lblMsg.Visible = true;
            }
            finally
            {
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',6,6);</script>", false);
            }
        }

        protected void btnCopy_Click(object sender, EventArgs e)
        {
            ReceiptInfo receiptInfo = base.DataEntityViewState as ReceiptInfo;
            if (receiptInfo != null)
            {
                receiptInfo.IsCopy = "Y";
                receiptInfo.OldReceiptID = this.txtReceiptID.Text;
                base.DataEntityViewState = receiptInfo;
            }
            this.txtReceiptID.Text = "";
            this.hdnReceiptID.Value = "";
            this.txtReceiptID.Enabled = true;
            this.ddlStatus.SelectedValue = "New";
            this.btnAddDetail.Visible = false;
            this.btnDeleteDetail.Visible = false;
            this.btnImportData.Visible = false;
            this.hdnFlag.Value = "0";
            this.hdnCopy.Value = "1";
            this.lblMsg.Text = base.GetGlobalMsgResource("F4100_014");
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.txtReceiptID.Text.Trim()))
            {
                try
                {
                    if (this.ddlStatus.SelectedValue.ToUpper() != "NEW")
                    {
                        this.lblMsg.Text = base.GetGlobalMsgResource("F4100_011");
                    }
                    else
                    {
                        List<string> receiptIDs = new List<string> {
                            this.txtReceiptID.Text.Trim()
                        };
                        this.lblMsg.Text = InboundServiceClientProxy.GetInstance().DeleteReceiptInfo(receiptIDs) + base.GetGlobalMsgResource("F4100_012");
                        this.btnSave.Enabled = false;
                        this.btnDelete.Enabled = false;
                        this.btnCopy.Enabled = false;
                        base.DataEntityViewState = null;
                        this.gvReceiptDetail.Enabled = false;
                        this.gvReceiptDetail.Columns[3].Visible = false;
                        this.btnAddDetail.Enabled = false;
                        this.btnDeleteDetail.Enabled = false;
                        this.btnImportData.Enabled = false;
                    }
                }
                catch (Exception ex)
                {
                    this.lblMsg.Text = base.GetGlobalMsgResource("F4100_013") + ex.Message;
                }
            }
        }

        protected void btnDeleteDetail_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.hdnIspalletized.Value == "Y")
                {
                    this.lblMsg.Text = base.GetGlobalMsgResource("F4100_016");
                }
                else if (!string.IsNullOrEmpty(this.txtReceiptID.Text.Trim()) && (this.hdnFlag.Value == "1"))
                {
                    List<string> receiptID = base.GetSelectedIDsInGridView(this.gvReceiptDetail, "RECEIPT_ID");
                    List<string> lineID = base.GetSelectedIDsInGridView(this.gvReceiptDetail, "RECEIPT_LINE_ID");
                    List<string> listStatus = base.GetSelectedIDsInGridView(this.gvReceiptDetail, "STATUS");
                    if ((listStatus != null) && (listStatus.Count > 0))
                    {
                        for (int i = 0; i < listStatus.Count; i++)
                        {
                            if (listStatus[i].ToUpper() != "NEW")
                            {
                                this.lblMsg.Text = base.GetGlobalMsgResource("F4100_011");
                                return;
                            }
                        }
                    }
                    if ((receiptID.Count > 0) && (lineID.Count > 0))
                    {
                        this.lblMsg.Text = InboundDetailServiceClientProxy.GetInstance().DeleteReceiptDetailInfo(receiptID, lineID) + base.GetGlobalMsgResource("F4100_012");
                        this.gvReceiptDetail.DataSource = null;
                        this.gvReceiptDetail.DataBind();
                        this.Detail_Load();
                    }
                    else
                    {
                        this.lblMsg.Text = base.GetGlobalMsgResource("F4100_017");
                    }
                }
                else
                {
                    this.lblMsg.Text = base.GetGlobalMsgResource("F4100_018");
                }
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = base.GetGlobalMsgResource("F4100_019") + ex.Message;
            }
            finally
            {
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',6,6);</script>", false);
            }
        }

        protected void btnFirst_Click(object sender, EventArgs e)
        {
            WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptQuery = this.GetReceiptDetailQueryEntity();
            receiptQuery.CurrentPage = "0";
            this.BindDataReceiptDetail(receiptQuery);
            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", " <script type=\"text/javascript\" >setTab('one',6,6); </script>", false);
        }

        protected void btnGoBack_Click(object sender, EventArgs e)
        {
            switch (this.hdnFrom.Value)
            {
                case "query":
                    base.Response.Redirect("ASNQuery.aspx", false);
                    break;

                case "list":
                    base.Response.Redirect("ASNList.aspx?from=edit", false);
                    break;
            }
        }

        protected void btnImportData_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.ddlStatus.SelectedValue.ToUpper() == "NEW")
                {
                    if (string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                    {
                        this.lblMsg.Text = base.GetGlobalMsgResource("F4100_002");
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(this.hdnLineID.Value))
                        {
                            this.InsertReceiptInfo();
                            this.hdnLineID.Value = "10";
                        }
                        ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',6,6);DataImport();</script>", false);
                    }
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',6,6);</script>", false);
                this.lblMsg.Text = ex.Message;
            }
        }

        protected void btnInputPO_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(this.hdnImportPOValue.Value))
                {
                    if (this.hdnIspalletized.Value == "Y")
                    {
                        this.lblMsg.Text = base.GetGlobalMsgResource("F4100_020");
                        return;
                    }
                    this.ViewState["IsInport"] = "1";
                    this.InputFromPO();
                }
                this.txtPoID.Focus();
                this.hdnPageType.Value = "0";
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = ex.Message;
            }
            finally
            {
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", " <script type=\"text/javascript\" >setTab('one',6,6) </script>", false);
            }
        }

        protected void btnInputSO_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(this.hdnSoID.Value))
                {
                    string[] strSo = this.hdnSoID.Value.Substring(0, this.hdnSoID.Value.Length - 1).Split(new char[] { ';' });
                    string[] strLineID = strSo[1].Split(new char[] { ',' });
                    ReceiptInfo receiptInfo = InboundServiceClientProxy.GetInstance().ImporFormSo(strSo[0], strLineID.ToList<string>(), this.txtReceiptID.Text, this.hdnLineID.Value, this.ddlReceiptType.SelectedValue);
                    if (receiptInfo != null)
                    {
                        this.LoadReceipt(receiptInfo);
                        base.DataEntityViewState = receiptInfo;
                        this.hdnFlag.Value = "1";
                        this.lblMsg.Text = receiptInfo.ReceiptID + "导入成功！";
                    }
                }
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = ex.Message;
            }
        }

        protected void btnLast_Click(object sender, EventArgs e)
        {
            WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptQuery = this.GetReceiptDetailQueryEntity();
            receiptQuery.CurrentPage = (this.PagerFooter.TotalPages - 1).ToString();
            this.BindDataReceiptDetail(receiptQuery);
            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", " <script type=\"text/javascript\" >setTab('one',6,6); </script>", false);
        }

        protected void btnNext_Click(object sender, EventArgs e)
        {
            WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptQuery = this.GetReceiptDetailQueryEntity();
            if (int.Parse(receiptQuery.CurrentPage) < (this.PagerFooter.TotalPages - 1))
            {
                receiptQuery.CurrentPage = (int.Parse(receiptQuery.CurrentPage) + 1).ToString();
                this.BindDataReceiptDetail(receiptQuery);
            }
            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", " <script type=\"text/javascript\" >setTab('one',6,6); </script>", false);
        }

        protected void btnPrevious_Click(object sender, EventArgs e)
        {
            WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptQuery = this.GetReceiptDetailQueryEntity();
            if (int.Parse(receiptQuery.CurrentPage) > 0)
            {
                receiptQuery.CurrentPage = (int.Parse(receiptQuery.CurrentPage) - 1).ToString();
                this.BindDataReceiptDetail(receiptQuery);
            }
            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", " <script type=\"text/javascript\" >setTab('one',6,6); </script>", false);
        }

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            this.gvReceiptDetail.DataSource = null;
            this.gvReceiptDetail.DataBind();
            this.Detail_Load();
            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", " <script type=\"text/javascript\" >setTab('one',6,6);$.unblockUI(); </script>", false);
        }

        protected void btnReport_Click(object sender, EventArgs e)
        {
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
            {
                this.lblMsg.Text = base.GetGlobalMsgResource("F4100_002");
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',1,5);</script>", false);
            }
            else if (string.IsNullOrEmpty(this.txtArrivalDate.Text.Trim()))
            {
                this.lblMsg.Text = base.GetGlobalMsgResource("F4100_003");
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',3,5);</script>", false);
            }
            else
            {
                if ((this.ViewState["IsInport"] != null) && (this.ViewState["IsInport"].ToString() == "1"))
                {
                    this.UpdateReceiptInfo();
                    this.ViewState["IsInport"] = null;
                }
                else if (this.hdnFlag.Value == "1")
                {
                    this.UpdateReceiptInfo();
                }
                else
                {
                    this.InsertReceiptInfo();
                }
                if (this.hdnCopy.Value == "1")
                {
                    this.SetReceiptInfo2Form();
                    this.CountrolsClick();
                    this.Detail_Load();
                }
                this.hdnPageQty.Value = "0";
                this.btnAddDetail.Visible = true;
                this.btnDeleteDetail.Visible = true;
                this.btnImportData.Visible = true;
            }
        }

        private WMS6.Web.InboundServiceRef.ReceiptDetailQueryEntity ConvertReceiptDetailQueryEntityByInBound(WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptdetailQueryEntity)
        {
            WMS6.Web.InboundServiceRef.ReceiptDetailQueryEntity receiptDetailQueryInboundDetail = null;
            if (receiptdetailQueryEntity != null)
            {
                receiptDetailQueryInboundDetail = new WMS6.Web.InboundServiceRef.ReceiptDetailQueryEntity {
                    IsGetAll = receiptdetailQueryEntity.IsGetAll,
                    CurrentPage = receiptdetailQueryEntity.CurrentPage,
                    PageSize = receiptdetailQueryEntity.PageSize,
                    SortField = receiptdetailQueryEntity.SortField,
                    SortDirection = receiptdetailQueryEntity.SortDirection,
                    IsPalletized = receiptdetailQueryEntity.IsPalletized,
                    ReceiptID = receiptdetailQueryEntity.ReceiptID
                };
            }
            return receiptDetailQueryInboundDetail;
        }

        private WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity ConvertReceiptDetailQueryEntityByInBoundDetail(WMS6.Web.InboundServiceRef.ReceiptDetailQueryEntity receiptdetailQueryEntity)
        {
            WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptDetailQueryInboundDetail = new WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity();
            if (receiptdetailQueryEntity != null)
            {
                receiptDetailQueryInboundDetail.IsGetAll = receiptdetailQueryEntity.IsGetAll;
                receiptDetailQueryInboundDetail.CurrentPage = receiptdetailQueryEntity.CurrentPage;
                receiptDetailQueryInboundDetail.PageSize = receiptdetailQueryEntity.PageSize;
                receiptDetailQueryInboundDetail.SortField = receiptdetailQueryEntity.SortField;
                receiptDetailQueryInboundDetail.SortDirection = receiptdetailQueryEntity.SortDirection;
                receiptDetailQueryInboundDetail.IsPalletized = receiptdetailQueryEntity.IsPalletized;
                receiptDetailQueryInboundDetail.ReceiptID = receiptdetailQueryEntity.ReceiptID;
            }
            return receiptDetailQueryInboundDetail;
        }

        private void CountrolsClick()
        {
            this.txtReceiptID.Attributes.Add("RecordValue", "0");
            this.txtReceiptID.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtReceiptID.Text + "',this, 'hdnPageQty'); return true; ");
            this.ddlStatus.Attributes.Add("RecordValue", "0");
            this.ddlStatus.Attributes.Add("onfocusout", "RecordPageValue('" + this.ddlStatus.SelectedItem.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtReceiptDate.Attributes.Add("RecordValue", "0");
            this.txtReceiptDate.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtReceiptDate.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtOwnerID.Attributes.Add("RecordValue", "0");
            this.txtOwnerID.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtOwnerID.Text + "',this, 'hdnPageQty'); return true; ");
            this.ddlReceiptType.Attributes.Add("RecordValue", "0");
            this.ddlReceiptType.Attributes.Add("onfocusout", "RecordPageValue('" + this.ddlReceiptType.SelectedItem.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtPoID.Attributes.Add("RecordValue", "0");
            this.txtPoID.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtPoID.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtExpetedReceiptDate.Attributes.Add("RecordValue", "0");
            this.txtExpetedReceiptDate.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtExpetedReceiptDate.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtExternalReceiptID.Attributes.Add("RecordValue", "0");
            this.txtExternalReceiptID.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtExternalReceiptID.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtRma.Attributes.Add("RecordValue", "0");
            this.txtRma.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtRma.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtPackingSlipNumber.Attributes.Add("RecordValue", "0");
            this.txtPackingSlipNumber.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtPackingSlipNumber.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtWareHouseRef.Attributes.Add("RecordValue", "0");
            this.txtWareHouseRef.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtWareHouseRef.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorID.Attributes.Add("RecordValue", "0");
            this.txtVendorID.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorID.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorName.Attributes.Add("RecordValue", "0");
            this.txtVendorName.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorName.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorCity.Attributes.Add("RecordValue", "0");
            this.txtVendorCity.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorCity.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorProv.Attributes.Add("RecordValue", "0");
            this.txtVendorProv.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorProv.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorContact.Attributes.Add("RecordValue", "0");
            this.txtVendorContact.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorContact.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorFax.Attributes.Add("RecordValue", "0");
            this.txtVendorFax.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorFax.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorEmail.Attributes.Add("RecordValue", "0");
            this.txtVendorEmail.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorEmail.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorPhone.Attributes.Add("RecordValue", "0");
            this.txtVendorPhone.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorPhone.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorZip.Attributes.Add("RecordValue", "0");
            this.txtVendorZip.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorZip.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorCountry.Attributes.Add("RecordValue", "0");
            this.txtVendorCountry.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorCountry.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVendorRef.Attributes.Add("RecordValue", "0");
            this.txtVendorRef.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVendorRef.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierID.Attributes.Add("RecordValue", "0");
            this.txtCarrierID.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierID.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierName.Attributes.Add("RecordValue", "0");
            this.txtCarrierName.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierName.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierPhone.Attributes.Add("RecordValue", "0");
            this.txtCarrierPhone.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierPhone.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierProv.Attributes.Add("RecordValue", "0");
            this.txtCarrierProv.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierProv.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierRef.Attributes.Add("RecordValue", "0");
            this.txtCarrierRef.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierRef.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierZIP.Attributes.Add("RecordValue", "0");
            this.txtCarrierZIP.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierZIP.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierMail.Attributes.Add("RecordValue", "0");
            this.txtCarrierMail.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierMail.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierFax.Attributes.Add("RecordValue", "0");
            this.txtCarrierFax.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierFax.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierCountry.Attributes.Add("RecordValue", "0");
            this.txtCarrierCountry.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierCountry.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierCity.Attributes.Add("RecordValue", "0");
            this.txtCarrierCity.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierCity.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierAddress.Attributes.Add("RecordValue", "0");
            this.txtCarrierAddress.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierAddress.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtVehicleNumber.Attributes.Add("RecordValue", "0");
            this.txtVehicleNumber.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtVehicleNumber.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtSrcCountry.Attributes.Add("RecordValue", "0");
            this.txtSrcCountry.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtSrcCountry.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtDestCountry.Attributes.Add("RecordValue", "0");
            this.txtDestCountry.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtDestCountry.Text + "',this, 'hdnPageQty'); return true; ");
            this.ddlContainerType.Attributes.Add("RecordValue", "0");
            this.ddlContainerType.Attributes.Add("onfocusout", "RecordPageValue('" + this.ddlContainerType.SelectedItem.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtContainerQty.Attributes.Add("RecordValue", "0");
            this.txtContainerQty.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtContainerQty.Text + "',this, 'hdnPageQty'); return true; ");
            this.ddlTransportationMode.Attributes.Add("RecordValue", "0");
            this.ddlTransportationMode.Attributes.Add("onfocusout", "RecordPageValue('" + this.ddlTransportationMode.SelectedItem.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtTrailerNumber.Attributes.Add("RecordValue", "0");
            this.txtTrailerNumber.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtTrailerNumber.Text + "',this, 'hdnPageQty'); return true; ");
            this.ddlPaymentTerm.Attributes.Add("RecordValue", "0");
            this.ddlPaymentTerm.Attributes.Add("onfocusout", "RecordPageValue('" + this.ddlPaymentTerm.SelectedItem.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtPlaceOfLoading.Attributes.Add("RecordValue", "0");
            this.txtPlaceOfLoading.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtPlaceOfLoading.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtTrailerOwner.Attributes.Add("RecordValue", "0");
            this.txtTrailerOwner.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtTrailerOwner.Text + "',this, 'hdnPageQty'); return true; ");
            this.ddlIncoTerms.Attributes.Add("RecordValue", "0");
            this.ddlIncoTerms.Attributes.Add("onfocusout", "RecordPageValue('" + this.ddlIncoTerms.SelectedItem.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtPlaceOfDischarge.Attributes.Add("RecordValue", "0");
            this.txtPlaceOfDischarge.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtPlaceOfDischarge.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtDriverName.Attributes.Add("RecordValue", "0");
            this.txtDriverName.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtDriverName.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtPlaceOfDelivery.Attributes.Add("RecordValue", "0");
            this.txtPlaceOfDelivery.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtPlaceOfDelivery.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtArrivalDate.Attributes.Add("RecordValue", "0");
            this.txtArrivalDate.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtArrivalDate.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtCarrierRef.Attributes.Add("RecordValue", "0");
            this.txtCarrierRef.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtCarrierRef.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf1.Attributes.Add("RecordValue", "0");
            this.txtUdf1.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf1.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf2.Attributes.Add("RecordValue", "0");
            this.txtUdf2.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf2.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf3.Attributes.Add("RecordValue", "0");
            this.txtUdf3.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf3.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf4.Attributes.Add("RecordValue", "0");
            this.txtUdf4.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf4.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf5.Attributes.Add("RecordValue", "0");
            this.txtUdf5.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf5.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf6.Attributes.Add("RecordValue", "0");
            this.txtUdf6.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf6.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf7.Attributes.Add("RecordValue", "0");
            this.txtUdf7.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf7.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf8.Attributes.Add("RecordValue", "0");
            this.txtUdf8.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf8.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf9.Attributes.Add("RecordValue", "0");
            this.txtUdf9.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf9.Text + "',this, 'hdnPageQty'); return true; ");
            this.txtUdf10.Attributes.Add("RecordValue", "0");
            this.txtUdf10.Attributes.Add("onfocusout", "RecordPageValue('" + this.txtUdf10.Text + "',this, 'hdnPageQty'); return true; ");
        }

        protected void ddlReceiptType_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            this.ddlStatus.Enabled = false;
            this.txtPoID.Enabled = false;
            this.txtTotalExceptQty.Enabled = false;
            this.txtTotalReceiptQty.Enabled = false;
            this.txtTotalGrossWeight.Enabled = false;
            this.txtTotalCube.Enabled = false;
            this.txtCreatedBy.Enabled = false;
            this.txtCreatedDate.Enabled = false;
            this.hdnTypeValue.Value = this.ddlReceiptType.SelectedValue;
            if (string.Compare(this.ddlReceiptType.SelectedValue, "Return", true) == 0)
            {
                this.txtVendorRef.Text = "";
                this.txtVendorRef.Visible = false;
                this.lblVendorRef.Visible = false;
                if (base.UserInfo.Preference.Lang.ToLower() == "zh-cn")
                {
                    this.one2.Text = "&nbsp;客户&nbsp;";
                    this.lblVendorID.Text = "客户代码";
                    this.lblVendorName.Text = "客户名称";
                }
                else
                {
                    this.one2.Text = "&nbsp;Customer&nbsp;";
                    this.lblVendorID.Text = "Customer ID";
                    this.lblVendorName.Text = "Customer Name";
                }
            }
            else if (base.UserInfo.Preference.Lang.ToLower() == "zh-cn")
            {
                this.one2.Text = "&nbsp;供应商&nbsp;";
                this.lblVendorID.Text = "供应商代码";
                this.lblVendorName.Text = "供应商名称";
            }
            else
            {
                this.one2.Text = "&nbsp;Vendor&nbsp;";
                this.lblVendorID.Text = "Vendor ID";
                this.lblVendorName.Text = "Vendor Name";
            }
        }

        private void Detail_Load()
        {
            WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptDetailQueryEntity = new WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity();
            try
            {
                if (!string.IsNullOrEmpty(this.txtSkuQuery.Text))
                {
                    receiptDetailQueryEntity.SkuID = " LIKE '%" + this.txtSkuQuery.Text + "%'";
                }
                if (!string.IsNullOrEmpty(this.ddlStatusQuery.SelectedValue))
                {
                    receiptDetailQueryEntity.Status = " LIKE '%" + this.ddlStatusQuery.SelectedValue + "%'";
                }
                receiptDetailQueryEntity.IsGetAll = false;
                receiptDetailQueryEntity.CurrentPage = "0";
                receiptDetailQueryEntity.PageSize = this.gvReceiptDetail.PageSize.ToString();
                receiptDetailQueryEntity.SortField = "RD.RECEIPT_ID";
                receiptDetailQueryEntity.SortDirection = "DESC";
                receiptDetailQueryEntity.IsPalletized = this.hdnIspalletized.Value;
                receiptDetailQueryEntity.ReceiptID = this.txtReceiptID.Text;
                this.SetReceiptDetailQueryEntity(receiptDetailQueryEntity);
                this.PagerFooter.PageSize = this.gvReceiptDetail.PageSize;
                DataSet ds = this.BindDataReceiptDetail(receiptDetailQueryEntity);
                if ((ds.Tables[2] != null) && (ds.Tables[2].Rows.Count > 0))
                {
                    if (ds.Tables[1].Columns.Count > 3)
                    {
                        this.hdnLineID.Value = (Convert.ToInt32(ds.Tables[1].Rows[0]["LineID"]) + 10).ToString();
                    }
                    else
                    {
                        this.hdnLineID.Value = "10";
                    }
                }
                else
                {
                    this.hdnLineID.Value = "10";
                }
                this.divM6.Attributes.Add("onclick", "setTab('one',6,6);");
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = ex.Message;
            }
        }

        protected string FormatReceiptUrl(string url, string receiptID, string receiptLineID, string ownerID)
        {
            return string.Format(url, new object[] { this.hdnFrom.Value.Trim(), receiptID, receiptLineID, ownerID, this.ddlReceiptType.SelectedValue });
        }

        private WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity GetReceiptDetailQueryEntity()
        {
            return (base.PageQueryEntityViewState as WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity);
        }

        protected void GoTo_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(((TextBox) this.PagerFooter.FindControl("txtGo2Page")).Text.Trim()))
            {
                WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptQuery = this.GetReceiptDetailQueryEntity();
                receiptQuery.CurrentPage = this.PagerFooter.GoToPage.ToString();
                this.BindDataReceiptDetail(receiptQuery);
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", " <script type=\"text/javascript\" >setTab('one',6,6); </script>", false);
            }
        }

        protected void gvReceiptDetail_Init(object sender, EventArgs e)
        {
            base.InitDetailGridView("F4011", this.gvReceiptDetail);
        }

        protected void gvReceiptDetail_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            (sender as GridView).PageIndex = e.NewPageIndex;
            (sender as GridView).DataSource = (base.DataEntityViewState as ReceiptInfo).ReceiptDetailInfos;
            (sender as GridView).DataBind();
            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", " <script type=\"text/javascript\" >setTab('one',6,6) </script>", false);
        }

        protected void gvReceiptDetail_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int i = this.gvReceiptDetail.PageIndex * this.gvReceiptDetail.PageSize;
                e.Row.Cells[1].Text = ((e.Row.RowIndex + 1) + i).ToString();
                base.SetGridViewLongTextLabel((Label) e.Row.FindControl("lblSkuDescr"));
                if (((Label) e.Row.FindControl("lblExpectedQty")) != null)
                {
                    this.totalExpectedQty += decimal.Parse(((Label) e.Row.FindControl("lblExpectedQty")).Text);
                }
                if (((Label) e.Row.FindControl("lblReceivedQty")) != null)
                {
                    this.totalReceivedQty += decimal.Parse(((Label) e.Row.FindControl("lblReceivedQty")).Text);
                }
            }
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                this.lblTotalReceivedQty.Text = base.GetPreferenceDigit(this.totalReceivedQty);
                this.lblTotalExpectedQty.Text = base.GetPreferenceDigit(this.totalExpectedQty);
            }
        }

        protected void gvReceiptDetail_Sorting(object sender, GridViewSortEventArgs e)
        {
            try
            {
                WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptDetailQueryEntity = this.GetReceiptDetailQueryEntity();
                if (base.GridViewSortDirection == SortDirection.Ascending)
                {
                    base.GridViewSortDirection = SortDirection.Descending;
                    receiptDetailQueryEntity.SortDirection = "DESC";
                }
                else
                {
                    base.GridViewSortDirection = SortDirection.Ascending;
                    receiptDetailQueryEntity.SortDirection = "ASC";
                }
                receiptDetailQueryEntity.SortField = e.SortExpression;
                this.BindDataReceiptDetail(receiptDetailQueryEntity);
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = ex.Message;
            }
            finally
            {
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',6,6);</script>", false);
            }
        }

        private void InputFromPO()
        {
            try
            {
                string createdBy = base.UserInfo.UserID;
                string receiptID = InboundServiceClientProxy.GetInstance().InportFromPO(this.hdnImportPOValue.Value, this.txtReceiptID.Text.Trim(), this.ddlReceiptType.SelectedValue, createdBy);
                this.txtReceiptID.Text = receiptID;
                this.hdnReceiptID.Value = receiptID;
                this.hdnFlag.Value = "1";
                this.SetReceiptInfo2Form();
                this.lblMsg.Text = receiptID + base.GetGlobalMsgResource("F4100_004");
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = base.GetGlobalMsgResource("F4100_005") + ex.Message;
            }
        }

        private void InsertReceiptInfo()
        {
            try
            {
                ReceiptInfo receiptInfo = new ReceiptInfo();
                if (base.DataEntityViewState != null)
                {
                    receiptInfo = base.DataEntityViewState as ReceiptInfo;
                }
                receiptInfo = this.SetReceiptInfo(receiptInfo);
                receiptInfo.CreatedBy = base.UserInfo.UserID;
                string receiptID = InboundServiceClientProxy.GetInstance().InsertReceiptInfo(receiptInfo);
                receiptInfo.ReceiptID = receiptID;
                this.lblMsg.Text = receiptID + base.GetGlobalMsgResource("F4100_009");
                this.txtReceiptID.Text = receiptID;
                base.DataEntityViewState = receiptInfo;
                this.hdnFlag.Value = "1";
                this.hdnReceiptID.Value = receiptID;
                this.txtReceiptID.Enabled = false;
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = base.GetGlobalMsgResource("F4100_010") + ex.Message;
            }
        }

        protected void lnkbtnUdf_Click(object sender, EventArgs e)
        {
            try
            {
                UDFInfo udfInfo = new UDFInfo {
                    Udf1 = this.txtUdf1.Text,
                    Udf2 = this.txtUdf2.Text,
                    Udf3 = this.txtUdf3.Text,
                    Udf4 = this.txtUdf4.Text,
                    Udf5 = this.txtUdf5.Text,
                    Udf6 = this.txtUdf6.Text,
                    Udf7 = this.txtUdf7.Text,
                    Udf8 = this.txtUdf8.Text,
                    Udf9 = this.txtUdf9.Text,
                    Udf10 = this.txtUdf10.Text,
                    Remark = this.txtRemark.Text
                };
                if (!string.IsNullOrEmpty(CommoneMethodServiceClientProxy.GetInstance().UpdateUDF(this.txtReceiptID.Text.Trim(), udfInfo, "RECEIPT")))
                {
                    this.lblMsg.Text = "自定义字段更新成功！";
                }
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = "操作失败：" + ex.Message;
            }
        }

        private void LoadData()
        {
            base.BindData2DDLBySysCode(this.ddlReceiptType, "ReceiptType");
            base.BindData2DDLBySysCode(this.ddlStatus, "ReceiptStatus");
            base.BindData2DDLBySysCode(this.ddlStatusQuery, "ReceiptStatus");
            this.ddlStatusQuery.Items.Insert(0, "");
            base.BindData2DDLBySysCode(this.ddlTransportationMode, "TransportMode");
            base.BindData2DDLBySysCode(this.ddlPaymentTerm, "PaymentTerms");
            base.BindData2DDLBySysCode(this.ddlIncoTerms, "IncoTerms");
            base.BindData2DDLBySysCode(this.ddlContainerType, "ContainerType");
            this.txtCreatedBy.Text = base.UserInfo.UserID;
            this.txtCreatedDate.Text = base.GetPreferenceShortDate(DateTime.Now);
            this.txtArrivalDate.Text = base.GetPreferenceShortDate(DateTime.Now);
            if (!string.IsNullOrEmpty(base.Request.QueryString["ID"]))
            {
                this.hdnReceiptID.Value = base.Request.QueryString["ID"].ToString();
                if (base.PageQueryEntitySession != null)
                {
                    WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptQuery = base.PageQueryEntitySession as WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity;
                    if ((receiptQuery != null) && (receiptQuery.ReceiptID == this.hdnReceiptID.Value))
                    {
                        this.SetReceiptDetailQueryEntity(receiptQuery);
                    }
                    base.PageQueryEntitySession = null;
                }
                this.SetReceiptInfo2Form();
                this.hdnFlag.Value = "1";
            }
            else
            {
                base.SetDefaultOwner(this.txtOwnerID);
            }
            if (!string.IsNullOrEmpty(base.Request.QueryString["from"]))
            {
                this.hdnFrom.Value = base.Request.QueryString["from"].ToString();
            }
            if (!string.IsNullOrEmpty(base.Request.QueryString["detail"]))
            {
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',6,6);</script>", false);
            }
        }

        private void LoadReceipt(ReceiptInfo receiptInfo)
        {
            this.txtReceiptID.Text = receiptInfo.ReceiptID;
            this.ddlStatus.SelectedValue = receiptInfo.Status;
            if (receiptInfo.ReceiptType.ToUpper() == "TRANSFER")
            {
                this.lnkbtnPrintReceipt.OnClientClick = "popPrintAllocationt()";
            }
            this.txtReceiptDate.Text = base.GetPreferenceShortDate(receiptInfo.ReceiptDate);
            this.txtOwnerID.Text = receiptInfo.OwnerID;
            this.txtOwnerID.Enabled = false;
            this.imgOwnerID.Visible = false;
            this.ddlReceiptType.SelectedValue = receiptInfo.ReceiptType;
            this.ddlReceiptType_OnSelectedIndexChanged(null, null);
            this.ddlReceiptType.Enabled = false;
            this.txtPoID.Text = receiptInfo.PoID;
            this.hdnInportValue.Value = receiptInfo.PoID;
            this.txtExpetedReceiptDate.Text = base.GetPreferenceShortDate(receiptInfo.ExpectedReceiptDate);
            this.txtExternalReceiptID.Text = receiptInfo.ExternalReceiptID;
            this.txtRma.Text = receiptInfo.Rma;
            this.txtPackingSlipNumber.Text = receiptInfo.PackingSlipNumber;
            this.txtWareHouseRef.Text = receiptInfo.WarehouseRef;
            this.hdnIspalletized.Value = receiptInfo.IsPalletized;
            this.txtVendorID.Text = receiptInfo.VendorID;
            this.txtVendorName.Text = receiptInfo.VendorName;
            this.txtVendorCity.Text = receiptInfo.VendorCity;
            this.txtVendorProv.Text = receiptInfo.VendorProv;
            this.txtVendorContact.Text = receiptInfo.VendorContact;
            this.txtVendorFax.Text = receiptInfo.VendorFax;
            this.txtVendorEmail.Text = receiptInfo.VendorEmail;
            this.txtVendorPhone.Text = receiptInfo.VendorPhone;
            this.txtVendorZip.Text = receiptInfo.VendorZip;
            this.txtVendorCountry.Text = receiptInfo.VendorCountry;
            this.txtVendorRef.Text = receiptInfo.VendorRef;
            this.txtVendorAddress.Text = receiptInfo.VendorAddress;
            this.txtCarrierID.Text = receiptInfo.CarrierID;
            this.txtCarrierName.Text = receiptInfo.CarrierName;
            this.txtCarrierPhone.Text = receiptInfo.CarrierPhone;
            this.txtCarrierProv.Text = receiptInfo.CarrierProv;
            this.txtCarrierRef.Text = receiptInfo.CarrierRef;
            this.txtCarrierZIP.Text = receiptInfo.CarrierZip;
            this.txtCarrierMail.Text = receiptInfo.CarrierEmail;
            this.txtCarrierFax.Text = receiptInfo.CarrierFax;
            this.txtCarrierCountry.Text = receiptInfo.CarrierCountry;
            this.txtCarrierContact.Text = receiptInfo.CarrierContact;
            this.txtCarrierCity.Text = receiptInfo.CarrierCity;
            this.txtCarrierAddress.Text = receiptInfo.CarrierAddress;
            this.txtVehicleNumber.Text = receiptInfo.VehicleNumber;
            this.txtSrcCountry.Text = receiptInfo.SrcCountry;
            this.txtDestCountry.Text = receiptInfo.DestCountry;
            if (!string.IsNullOrEmpty(receiptInfo.ContainerType))
            {
                this.ddlContainerType.SelectedValue = receiptInfo.ContainerType;
            }
            this.txtContainerQty.Text = receiptInfo.ContainerQty.ToString();
            if (!string.IsNullOrEmpty(receiptInfo.TransportationMode))
            {
                this.ddlTransportationMode.SelectedValue = receiptInfo.TransportationMode;
            }
            this.txtTrailerNumber.Text = receiptInfo.TrailerNumber;
            if (!string.IsNullOrEmpty(receiptInfo.PaymentTerm))
            {
                this.ddlPaymentTerm.SelectedValue = receiptInfo.PaymentTerm;
            }
            this.txtPlaceOfLoading.Text = receiptInfo.PlaceOfLoading;
            this.txtTrailerOwner.Text = receiptInfo.TrailerOwner;
            if (!string.IsNullOrEmpty(receiptInfo.IncoTerms))
            {
                this.ddlIncoTerms.SelectedValue = receiptInfo.IncoTerms;
            }
            this.txtPlaceOfDischarge.Text = receiptInfo.PlaceOfDischarge;
            this.txtDriverName.Text = receiptInfo.DriverName;
            this.txtPlaceOfDelivery.Text = receiptInfo.PlaceOfDelivery;
            this.txtArrivalDate.Text = base.GetPreferenceShortDate(receiptInfo.ArrivalDate);
            this.txtCarrierRef.Text = receiptInfo.CarrierRef;
            this.txtUdf1.Text = receiptInfo.Udf1;
            this.txtUdf2.Text = receiptInfo.Udf2;
            this.txtUdf3.Text = receiptInfo.Udf3;
            this.txtUdf4.Text = receiptInfo.Udf4;
            this.txtUdf5.Text = receiptInfo.Udf5;
            this.txtUdf6.Text = receiptInfo.Udf6;
            this.txtUdf7.Text = receiptInfo.Udf7;
            this.txtUdf8.Text = receiptInfo.Udf8;
            this.txtUdf9.Text = receiptInfo.Udf9;
            this.txtUdf10.Text = receiptInfo.Udf10;
            this.txtRemark.Text = receiptInfo.Remark;
            this.txtTotalCube.Text = base.GetPreferenceDigit(receiptInfo.TotalCube);
            this.txtTotalExceptQty.Text = base.GetPreferenceDigit(receiptInfo.TotalExpectedQty);
            this.txtTotalGrossWeight.Text = base.GetPreferenceDigit(receiptInfo.TotalGrossWgt);
            this.txtTotalReceiptQty.Text = base.GetPreferenceDigit(receiptInfo.TotalReceivedQty);
            this.txtReceiptID.Enabled = false;
            this.txtCreatedBy.Text = receiptInfo.CreatedBy;
            this.txtCreatedDate.Text = base.GetPreferenceShortDate(receiptInfo.CreatedDate);
            if (receiptInfo.DataSetReceiptDetails != null)
            {
                base.BindData2GridView(this.gvReceiptDetail, receiptInfo.DataSetReceiptDetails);
                if ((receiptInfo.DataSetReceiptDetails != null) && (receiptInfo.DataSetReceiptDetails.Tables.Count > 1))
                {
                    this.PagerFooter.PageInfo = receiptInfo.DataSetReceiptDetails.Tables[1].Rows[0]["CurrentPage"].ToString() + " / " + receiptInfo.DataSetReceiptDetails.Tables[1].Rows[0]["TotalPagesCount"].ToString() + "&nbsp;&nbsp;&nbsp;共: " + receiptInfo.DataSetReceiptDetails.Tables[1].Rows[0]["TotalRecordsCount"].ToString();
                    this.PagerFooter.TotalPages = int.Parse(receiptInfo.DataSetReceiptDetails.Tables[1].Rows[0]["TotalPagesCount"].ToString());
                }
                if ((receiptInfo.DataSetReceiptDetails.Tables[2] != null) && (receiptInfo.DataSetReceiptDetails.Tables[2].Rows.Count > 0))
                {
                    if (receiptInfo.DataSetReceiptDetails.Tables[1].Columns.Count > 3)
                    {
                        this.hdnLineID.Value = (Convert.ToInt32(receiptInfo.DataSetReceiptDetails.Tables[1].Rows[0]["LineID"]) + 10).ToString();
                    }
                    else
                    {
                        this.hdnLineID.Value = "10";
                    }
                }
                else
                {
                    this.hdnLineID.Value = "10";
                }
            }
            this.UpdatePanel1.Update();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadData();
                this.CountrolsClick();
            }
        }

        protected void SavePageQuery_Click(object sender, EventArgs e)
        {
            WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptQuery = this.GetReceiptDetailQueryEntity();
            if (receiptQuery != null)
            {
                base.PageQueryEntitySession = receiptQuery;
            }
            string strUrl = this.FormatReceiptUrl("ASNDetail.aspx?from={0}&ID={1}&SeqNO={2}&owner={3}&type=Edit&ReceiptType={4}", this.txtReceiptID.Text, ((HtmlAnchor) sender).Title, this.txtOwnerID.Text);
            base.Response.Redirect(strUrl);
        }

        private void SetReceiptDetailQueryEntity(WMS6.Web.InboundDetailServiceRef.ReceiptDetailQueryEntity receiptQuery)
        {
            base.PageQueryEntityViewState = receiptQuery;
        }

        private ReceiptInfo SetReceiptInfo(ReceiptInfo receipt)
        {
            DateTime dt = DateTime.Now;
            decimal outDec = 0.0M;
            ReceiptInfo receiptInfo = receipt;
            receiptInfo.ReceiptID = this.txtReceiptID.Text.Trim();
            receiptInfo.Status = this.ddlStatus.SelectedValue;
            receiptInfo.OwnerID = this.txtOwnerID.Text.Trim();
            if (DateTime.TryParse(this.txtReceiptDate.Text.Trim(), out dt))
            {
                receiptInfo.ReceiptDate = DateTime.Parse(this.txtReceiptDate.Text.Trim());
            }
            else
            {
                receiptInfo.ReceiptDate = DateTime.Now;
            }
            receiptInfo.ReceiptType = this.ddlReceiptType.SelectedValue;
            receiptInfo.PoID = this.txtPoID.Text.Trim();
            if (DateTime.TryParse(this.txtExpetedReceiptDate.Text.Trim(), out dt))
            {
                receiptInfo.ExpectedReceiptDate = DateTime.Parse(this.txtExpetedReceiptDate.Text.Trim());
            }
            else
            {
                receiptInfo.ExpectedReceiptDate = DateTime.Now;
            }
            receiptInfo.ExternalReceiptID = this.txtExternalReceiptID.Text.Trim();
            receiptInfo.Rma = this.txtRma.Text.Trim();
            receiptInfo.PackingSlipNumber = this.txtPackingSlipNumber.Text.Trim();
            receiptInfo.WarehouseRef = this.txtWareHouseRef.Text.Trim();
            receiptInfo.VendorID = this.txtVendorID.Text.Trim();
            receiptInfo.VendorName = this.txtVendorName.Text.Trim();
            receiptInfo.VendorCity = this.txtVendorCity.Text.Trim();
            receiptInfo.VendorProv = this.txtVendorProv.Text.Trim();
            receiptInfo.VendorContact = this.txtVendorContact.Text.Trim();
            receiptInfo.VendorAddress = this.txtVendorAddress.Text.Trim();
            receiptInfo.VendorFax = this.txtVendorFax.Text.Trim();
            receiptInfo.VendorEmail = this.txtVendorEmail.Text.Trim();
            receiptInfo.VendorPhone = this.txtVendorPhone.Text.Trim();
            receiptInfo.VendorZip = this.txtVendorZip.Text.Trim();
            receiptInfo.VendorCountry = this.txtVendorCountry.Text.Trim();
            receiptInfo.VendorRef = this.txtVendorRef.Text.Trim();
            receiptInfo.CarrierID = this.txtCarrierID.Text;
            receiptInfo.CarrierName = this.txtCarrierName.Text;
            receiptInfo.CarrierPhone = this.txtCarrierPhone.Text;
            receiptInfo.CarrierProv = this.txtCarrierProv.Text;
            receiptInfo.CarrierRef = this.txtCarrierRef.Text;
            receiptInfo.CarrierZip = this.txtCarrierZIP.Text;
            receiptInfo.CarrierEmail = this.txtCarrierMail.Text;
            receiptInfo.CarrierFax = this.txtCarrierFax.Text;
            receiptInfo.CarrierCountry = this.txtCarrierCountry.Text;
            receiptInfo.CarrierContact = this.txtCarrierContact.Text;
            receiptInfo.CarrierCity = this.txtCarrierCity.Text;
            receiptInfo.CarrierAddress = this.txtCarrierAddress.Text;
            receiptInfo.VehicleNumber = this.txtVehicleNumber.Text.Trim();
            receiptInfo.SrcCountry = this.txtSrcCountry.Text.Trim();
            receiptInfo.ContainerType = this.ddlContainerType.SelectedValue;
            if (decimal.TryParse(this.txtContainerQty.Text.Trim(), out outDec))
            {
                receiptInfo.ContainerQty = decimal.Parse(this.txtContainerQty.Text.Trim());
            }
            else
            {
                receiptInfo.ContainerQty = outDec;
            }
            receiptInfo.TransportationMode = this.ddlTransportationMode.SelectedValue;
            receiptInfo.DestCountry = this.txtDestCountry.Text.Trim();
            receiptInfo.TrailerNumber = this.txtTrailerNumber.Text.Trim();
            receiptInfo.PaymentTerm = this.ddlPaymentTerm.SelectedValue;
            receiptInfo.PlaceOfLoading = this.txtPlaceOfLoading.Text.Trim();
            receiptInfo.TrailerOwner = this.txtTrailerOwner.Text.Trim();
            receiptInfo.IncoTerms = this.ddlIncoTerms.SelectedValue;
            receiptInfo.PlaceOfDischarge = this.txtPlaceOfDischarge.Text.Trim();
            receiptInfo.DriverName = this.txtDriverName.Text.Trim();
            receiptInfo.PlaceOfDelivery = this.txtPlaceOfDelivery.Text.Trim();
            if (DateTime.TryParse(this.txtArrivalDate.Text.Trim(), out dt))
            {
                receiptInfo.ArrivalDate = DateTime.Parse(this.txtArrivalDate.Text.Trim());
            }
            else
            {
                receiptInfo.ArrivalDate = DateTime.Now;
            }
            receiptInfo.CarrierRef = this.txtCarrierRef.Text.Trim();
            receiptInfo.Udf1 = this.txtUdf1.Text.Trim();
            receiptInfo.Udf2 = this.txtUdf2.Text.Trim();
            receiptInfo.Udf3 = this.txtUdf3.Text.Trim();
            receiptInfo.Udf4 = this.txtUdf4.Text.Trim();
            receiptInfo.Udf5 = this.txtUdf5.Text.Trim();
            receiptInfo.Udf6 = this.txtUdf6.Text.Trim();
            receiptInfo.Udf7 = this.txtUdf7.Text.Trim();
            receiptInfo.Udf8 = this.txtUdf8.Text.Trim();
            receiptInfo.Udf9 = this.txtUdf9.Text.Trim();
            receiptInfo.Udf10 = this.txtUdf10.Text.Trim();
            receiptInfo.Remark = this.txtRemark.Text.Trim();
            receiptInfo.LottableMatchRequired = "";
            receiptInfo.IsPalletized = this.hdnIspalletized.Value;
            receiptInfo.IsActive = "Y";
            return receiptInfo;
        }

        private void SetReceiptInfo2Form()
        {
            try
            {
                string receiptID = this.hdnReceiptID.Value.ToString();
                WMS6.Web.InboundServiceRef.ReceiptDetailQueryEntity receiptdetailQueryEntity = this.ConvertReceiptDetailQueryEntityByInBound(this.GetReceiptDetailQueryEntity());
                if (receiptdetailQueryEntity == null)
                {
                    receiptdetailQueryEntity = new WMS6.Web.InboundServiceRef.ReceiptDetailQueryEntity {
                        IsGetAll = false,
                        CurrentPage = "0",
                        PageSize = this.gvReceiptDetail.PageSize.ToString(),
                        SortField = "RD.RECEIPT_ID",
                        SortDirection = "DESC",
                        ReceiptID = receiptID
                    };
                    this.PagerFooter.PageSize = this.gvReceiptDetail.PageSize;
                }
                ReceiptInfo receiptInfo = InboundServiceClientProxy.GetInstance().GetReceiptInfoByID(receiptID, receiptdetailQueryEntity);
                base.DataEntityViewState = receiptInfo;
                if (receiptInfo != null)
                {
                    receiptdetailQueryEntity.IsPalletized = receiptInfo.IsPalletized;
                    this.SetReceiptDetailQueryEntity(this.ConvertReceiptDetailQueryEntityByInBoundDetail(receiptdetailQueryEntity));
                    this.LoadReceipt(receiptInfo);
                }
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = ex.Message;
            }
        }

        protected void txtCarrierID_TextChanged(object sender, EventArgs e)
        {
            CarrierInfo tradePartnerInfo = BaseInfoServiceClientProxy.GetInstance().GetInfoByID(this.txtCarrierID.Text.Trim(), "CARRIER") as CarrierInfo;
            if (!((tradePartnerInfo == null) || string.IsNullOrEmpty(tradePartnerInfo.CarrierID)))
            {
                this.txtCarrierName.Text = tradePartnerInfo.Company;
                this.txtCarrierAddress.Text = tradePartnerInfo.Address;
                this.txtCarrierCity.Text = tradePartnerInfo.City;
                this.txtCarrierContact.Text = tradePartnerInfo.Contact1;
                this.txtCarrierCountry.Text = tradePartnerInfo.Country;
                this.txtCarrierMail.Text = tradePartnerInfo.Email1;
                this.txtCarrierFax.Text = tradePartnerInfo.Fax1;
                this.txtCarrierPhone.Text = tradePartnerInfo.Phone1;
                this.txtCarrierProv.Text = tradePartnerInfo.State;
                this.txtCarrierZIP.Text = tradePartnerInfo.Zip;
                ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',3,6);</script>", false);
            }
            this.txtCarrierID.Focus();
            this.hdnPageType.Value = "0";
        }

        protected void txtPoID_TextChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.hdnImportPOValue.Value))
            {
                this.ViewState["IsInport"] = "1";
                this.InputFromPO();
            }
            this.txtPoID.Focus();
            this.hdnPageType.Value = "0";
        }

        protected void txtReceiptID_TextChanged(object sender, EventArgs e)
        {
            if (this.hdnCopy.Value != "1")
            {
                this.hdnReceiptID.Value = this.txtReceiptID.Text.Trim();
                this.SetReceiptInfo2Form();
            }
        }

        protected void txtVendorID_TextChanged(object sender, EventArgs e)
        {
            if (string.Compare(this.hdnTypeValue.Value, "Return", true) == 0)
            {
                CustomerInfo tradePartnerInfo = BaseInfoServiceClientProxy.GetInstance().GetInfoByID(this.txtVendorID.Text.Trim(), "CUSTOMER") as CustomerInfo;
                if (!((tradePartnerInfo == null) || string.IsNullOrEmpty(tradePartnerInfo.CustomerID)))
                {
                    this.txtVendorName.Text = tradePartnerInfo.Company;
                    this.txtVendorAddress.Text = tradePartnerInfo.Address;
                    this.txtVendorCity.Text = tradePartnerInfo.City;
                    this.txtVendorContact.Text = tradePartnerInfo.Contact1;
                    this.txtVendorCountry.Text = tradePartnerInfo.Country;
                    this.txtVendorEmail.Text = tradePartnerInfo.Email1;
                    this.txtVendorFax.Text = tradePartnerInfo.Fax1;
                    this.txtVendorPhone.Text = tradePartnerInfo.Phone1;
                    this.txtVendorProv.Text = tradePartnerInfo.State;
                    this.txtVendorZip.Text = tradePartnerInfo.Zip;
                }
            }
            else
            {
                VendorInfo tradePartnerInfo = BaseInfoServiceClientProxy.GetInstance().GetInfoByID(this.txtVendorID.Text.Trim(), "VENDOR") as VendorInfo;
                if (!((tradePartnerInfo == null) || string.IsNullOrEmpty(tradePartnerInfo.VendorID)))
                {
                    this.txtVendorName.Text = tradePartnerInfo.Company;
                    this.txtVendorAddress.Text = tradePartnerInfo.Address;
                    this.txtVendorCity.Text = tradePartnerInfo.City;
                    this.txtVendorContact.Text = tradePartnerInfo.Contact1;
                    this.txtVendorCountry.Text = tradePartnerInfo.Country;
                    this.txtVendorEmail.Text = tradePartnerInfo.Email1;
                    this.txtVendorFax.Text = tradePartnerInfo.Fax1;
                    this.txtVendorPhone.Text = tradePartnerInfo.Phone1;
                    this.txtVendorProv.Text = tradePartnerInfo.State;
                    this.txtVendorZip.Text = tradePartnerInfo.Zip;
                }
            }
            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "", "<script language='javascript'>setTab('one',2,6);</script>", false);
            this.txtVendorID.Focus();
            this.hdnPageType.Value = "0";
        }

        private void UpdateReceiptInfo()
        {
            try
            {
                if (this.ddlStatus.SelectedValue.ToUpper() != "NEW")
                {
                    this.lblMsg.Text = base.GetGlobalMsgResource("F4100_006");
                }
                else
                {
                    ReceiptInfo receiptInof = base.DataEntityViewState as ReceiptInfo;
                    receiptInof = this.SetReceiptInfo(receiptInof);
                    receiptInof.UpdatedBy = base.UserInfo.UserID;
                    this.lblMsg.Text = InboundServiceClientProxy.GetInstance().UpdateReceiptInfo(receiptInof) + base.GetGlobalMsgResource("F4100_007");
                }
            }
            catch (Exception ex)
            {
                this.lblMsg.Text = base.GetGlobalMsgResource("F4100_008") + ex.Message;
            }
        }
    }
}

